import config from './config';
import wepy from 'wepy';

const curl = [];
curl.get = function(url,func,data = {},faile){
    wepy.request({
        url:config.baseUrl+url,
        method:'GET',
        data:data
    }).then(response=>{
        if(response.data.code==0){
            func(response.data);
        }else if(response.data.code==11){
            
        }else{
            if(faile){
                faile(response.data)
            }
        }
    }).catch(error=>{
        console.error(error);
    });
}


export default curl;